package com.lwz.iterator;

public class Client {

	public static void main(String[] args) {
		Client client = new Client();
		client.someOperations();
	}

	public void someOperations(){
		String names[] = {"张三","李四","王五"};
		//创建聚合对象
		Aggreate aggreate = new ConcereteAggreate(names);
		//循环输出里面的值
		Iterator iterator = aggreate.createIterator();
		iterator.first();
		while(!iterator.isDone()){
			Object obj = iterator.currentItem();
			System.out.println("obj:"+obj);
			iterator.next();
		}
	}
}
